package Day004.ZuoYe01;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Test03 {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个日期,格式：yyyy-MM-dd");
        String s = sc.next();

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = sdf.parse(s);
        System.out.println(date);//Fri Jan 01 00:00:00 CST 1999

        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
        String s1 = sdf1.format(date);
        System.out.println(s1); //1999年01月01日
    }
}
